home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_game / blackj20.zip / BLACK.SRC < prev    next >
Text File  |  1996-04-19  |  24KB  |  967 lines

  1. # ┌──────────────────────────────────────────────────────────────────────────┐
  2. # │         BLACK.SRC   (Chuckle Box BlackJack)                              │
  3. # │                                                                          │
  4. # │          Version:   2.0  (Released 19 Apr 1996) for SBBS 2.20 - Rev B    │
  5. # │           Author:   Robert Nykvist  aka  Chuckles@VERT                   │
  6. # │                                                                          │
  7. # │      Quick Start:   1.  Move BLACK.SRC to your \EXEC directory.          │
  8. # │                     2.  Edit paths in script as needed for your system.  │
  9. # │                     3.  Compile BLACK.SRC with Baja compiler.            │
  10. # │                     4.  You determine how to make script available.      │
  11. # │                                                                          │
  12. # │             NOTE:       This script WILL modify user credits, and uses   │
  13. # │                         file I/O to create a log.  Check the paths!      │
  14. # └──────────────────────────────────────────────────────────────────────────┘
  15. !INCLUDE SBBSDEFS.INC
  16. !INCLUDE FILE_IO.INC
  17.  
  18. # Define Integer Variables
  19. int WINNINGS CARD COUNT TOTAL FILE TRACKPLAY
  20.  
  21. # Set WINNINGS to zero only upon entering the script.
  22. set WINNINGS 0
  23. set TRACKPLAY 0
  24.  
  25. # Top of Menu - Credit Check
  26. # If user doesn't have 5 k Credits, send them on their way.
  27. :top
  28. compare_ars $C !5
  29.   if_true
  30.     crlf
  31.     print "rhSorry, you don't have enough credits play today."
  32.     crlf
  33.     print "rhTry again tomorrow...n"
  34.     crlf
  35.     crlf
  36.     pause
  37.     cmd_pop
  38.     goto byebye
  39.   end_if
  40.  
  41. # Display Menu
  42. cls
  43. print "  hw4    Score        Result    n
  44. crlf
  45. print "n  ┌────────────┬────────────┐"
  46. crlf
  47. print "  │   hm0 -  8   n│   hm-25 k    n│"
  48. print "             nhwChuckle Box BlackJackn
  49. crlf
  50. print "  │   hm9 - 13   n│   hm-10 k    n│"
  51. print "                  hy Version 2.0n"
  52. crlf
  53. print "  │  hg14 - 17   n│    hg+5 k    n│"
  54. crlf
  55. print "  │  hg18 - 20   n│   hg+25 k    n│"
  56. print "            4hy Your Credits :w @BYTESLEFT@ n"
  57. crlf
  58. print "  │ hyBlack Jack n│   hy+50 k    n│"
  59. crlf
  60. print "  │   hrBusted   n│   hr-25 k    n│"
  61. crlf
  62. print "  └────────────┴────────────┘n"
  63. crlf
  64. crlf
  65.  
  66. # Note Node Location & make sure things are flowing in SYNC.
  67. node_action node_xtrn
  68.  
  69. # Display Prompt
  70. compare_ars SYSOP
  71.   if_true
  72.     mnemonics "  ~E)dit, ~V)iew, ~I)nfo, ~P)lay or ~Q)uit > "
  73.   else
  74.     mnemonics "  ~V)iew, ~I)nfo, ~P)lay or ~Q)uit > "
  75.   end_if
  76.  
  77.  
  78. # Get Key Input From User - ENTER allowed
  79. sync
  80. getkey EIPQV?\R
  81.  
  82. # Edit function for SysOp Only
  83. cmdkey e
  84.   compare_ars SYSOP
  85.     if_true
  86.       crlf
  87.       crlf
  88.       setstr "c:\\sbbs\\blackjck.log"
  89.       ungetstr
  90.       edit_text_file
  91.       cmd_pop
  92.       goto top
  93.     end_if
  94. end_cmd
  95.  
  96. # View last 16 lines of GUESS.LOG
  97. cmdkey v
  98.   cls
  99.   crlf
  100.   print "hg──────────────────────────w│nk2    Black Jack Log    nhw│g────────────────────────────n"
  101.   crlf
  102.   chkfile "c:\sbbs\blackjck.log"
  103.     if_true
  104.       setstr "c:\\sbbs\\blackjck.log"
  105.       printtail str 0 16
  106.       crlf
  107.     else
  108.       crlf
  109.       print "yh        No one has played yet, or the SysOp has screwed up somewhere."
  110.       crlf
  111.       crlf
  112.     end_if
  113.   print "hg──────────────────────────────────────────────────────────────────────────────n"
  114.   crlf
  115.   crlf
  116.   pause
  117. cmd_pop
  118. goto top
  119. end_cmd
  120.  
  121. # Display Instructions/Info
  122.   cmdkey I
  123.     cls
  124.     crlf
  125.     crlf
  126.       print "                      nhChuckle Box BlackJack - Ver 2.0"
  127.       crlf
  128.       print "                     yfor SBBS 2.20 B, by Robert Nykvist"
  129.       crlf
  130.       print "c                    The Chuckle Box BBS @ (334) 653-1888"
  131.       crlf
  132.       crlf
  133.       crlf
  134.       print "ìnc     Each BlackJack hand costsihr 5 knc credits!"
  135.       crlf
  136.       print "ìncWhen you hHITnc, the hmcomputer ncwill deal you a card,"
  137.       crlf
  138.       print "ïand keep a running htotal ncof the value of your hHITsnc."
  139.       crlf
  140.       crlf
  141.       print "ÜFace card = face value."
  142.       crlf
  143.       print "önc Jack = hm11, ncQueen = hm12, ncKing = hm13nc"
  144.       crlf
  145.       crlf
  146.       print "ìWhen you hSTOP nchitting, the computer will hmprocess"
  147.       crlf
  148.       print "ènc      credits according to the chart ncin the menu."
  149.       crlf
  150.       crlf
  151.       print "âCredits can hbuy ncyou hmextra ncon-line time using the Time/Credit hmBanknc!n"
  152.     crlf
  153.     crlf
  154.     crlf
  155.     pause
  156.     cmd_pop
  157.     goto top
  158.   end_cmd
  159.  
  160. # Wipe out display Prompt and go Play, but only for ANSI users.
  161.   cmdkey P
  162.     compare_ars $[
  163.       if_false
  164.         crlf
  165.         crlf
  166.         print "To play this game, you must be in ANSI mode....."
  167.         crlf
  168.         print "Non-ANSI mode detected.  Returning you to BBS..."
  169.         crlf
  170.         crlf
  171.         pause
  172.         cmd_pop
  173.         goto byebye
  174.       end_if
  175.     print "1Hn                                                  n"
  176.     crlf
  177.     cmd_pop
  178.     goto play
  179.   end_cmd
  180.  
  181. # Wipe out display Prompt and Leave
  182.   cmdkey Q
  183.     print "1Hn                                                  n"
  184.     crlf
  185.     cmd_pop
  186.     goto leave
  187.   end_cmd
  188. print "1Hn                                                  n"
  189. crlf
  190.  
  191. # Hitting Enter or fallthrough goes to Play,
  192. # again, checking for non-ANSI users.
  193. compare_ars $[
  194.   if_false
  195.     crlf
  196.     crlf
  197.     print "To play this game, you must be in ANSI mode....."
  198.     crlf
  199.     print "Non-ANSI mode detected.  Returning you to BBS..."
  200.     crlf
  201.     crlf
  202.     pause
  203.     cmd_pop
  204.     goto byebye
  205.   end_if
  206. print "1Hn                                                  n"
  207. crlf
  208. cmd_pop
  209. goto play
  210.  
  211. # Play BlackJack - Adjust Credits -5K for Ante,
  212. # Keep track of WINNINGS, Reset Integer variables.
  213. :play
  214. add trackplay 1
  215. adjust_user_credits -5
  216. sub WINNINGS 5
  217. set CARD 0
  218. set COUNT 0
  219. set TOTAL 0
  220.  
  221. # Switch/Case Loop using Integer Variable COUNT.
  222. # Purpose is to alter prompt colors after each hit
  223. # while updating totals.  Easier for user to see changes.
  224. # Many ANSI sequences used to control placement.
  225. :choosecard
  226. switch count
  227.   case 0
  228.     print "1H"
  229.     print "hcYour current score is: hm"
  230.     print TOTAL
  231.     print "1H"
  232.     print "                                         "
  233.     print "1H"
  234.     yes_no "Hit"
  235.       if_true
  236.         cmd_pop
  237.         goto hit
  238.       else
  239.         cmd_pop
  240.         goto stay
  241.       end_if
  242.   end_case
  243.   case 1
  244.     print "1H"
  245.     print "hyYour current score is: hc"
  246.     print TOTAL
  247.     print "1H"
  248.     print "                                         "
  249.     print "1H"
  250.     yes_no "Hit"
  251.       if_true
  252.         cmd_pop
  253.         goto hit
  254.       else
  255.         cmd_pop
  256.         goto stay
  257.       end_if
  258.   end_case
  259.   case 2
  260.     print "1H"
  261.     print "nmYour current score is: hy"
  262.     print TOTAL
  263.     print "1H"
  264.     print "                                         "
  265.     print "1H"
  266.     yes_no "Hit"
  267.       if_true
  268.         cmd_pop
  269.         goto hit
  270.       else
  271.         cmd_pop
  272.         goto stay
  273.       end_if
  274.   end_case
  275.   case 3
  276.     print "1H"
  277.     print "hcYour current score is: hm"
  278.     print TOTAL
  279.     print "1H"
  280.     print "                                         "
  281.     print "1H"
  282.     yes_no "Hit"
  283.       if_true
  284.         cmd_pop
  285.         goto hit
  286.       else
  287.         cmd_pop
  288.         goto stay
  289.       end_if
  290.   end_case
  291.   case 4
  292.     print "1H"
  293.     print "hgYour current score is: nc"
  294.     print TOTAL
  295.     print "1H"
  296.     print "                                         "
  297.     print "1H"
  298.     yes_no "Hit"
  299.       if_true
  300.         cmd_pop
  301.         goto hit
  302.       else
  303.         cmd_pop
  304.         goto stay
  305.       end_if
  306.   end_case
  307.   case 5
  308.     print "1H"
  309.     print "hmYour current score is: nc"
  310.     print TOTAL
  311.     print "1H"
  312.     print "                                         "
  313.     print "1H"
  314.     yes_no "Hit"
  315.       if_true
  316.         cmd_pop
  317.         goto hit
  318.       else
  319.         cmd_pop
  320.         goto stay
  321.       end_if
  322.   end_case
  323. end_switch
  324.  
  325. # Player wants a Hit  (Draw Card)
  326. # Randomly choose 1-13 for CARD variable
  327. # 0-12 becomes 1-13 by adding 1.
  328. :hit
  329. random CARD 12
  330. add CARD 1
  331.  
  332. # Problem here is displaying cards with single digits
  333. # as compared to double digit cards, not to mention
  334. # a standard placement of each card for nice graphics.
  335. # We again make use of Switch/Case loop, again using COUNT,
  336. # and ANSI sequence codes to control placement.
  337. :displaycard
  338. switch count
  339.   case 0
  340.  
  341. # Is the card two digit or single digit?
  342. # Double Digit card is one character wider...
  343. # That's the reason for this long case/if loop
  344.   compare CARD 10
  345.     if_less
  346.  
  347. # Display first card Hit on column 1  (1H)
  348. # This is assuming a 24 x 80 character screen.
  349.       print "1H"
  350.       print "hb╒════════╕  "
  351.       print "1H"
  352.       print "b│    c "
  353.       print CARD
  354.       print "b │  "
  355.       print "1H"
  356.       print "b│        │  "
  357.       print "1H"
  358. # Letters CB?  Chuckle Box of course.  :)
  359. # Customize this script as you see fit.
  360. # But kindly give credit where credit is due.
  361.       print "b│   CB   │  "
  362.       print "1H"
  363.       print "b│        │ "
  364.       print "1H"
  365.       print "b│ c"
  366.       print CARD
  367.       print "b     │  "
  368.       print "1H"
  369.       print "b╘════════╛  "
  370.       print "1H"
  371.       print "wThe card is a: g"
  372.       print CARD
  373.       print "      "
  374.    else
  375. # 10 or greater is one character wider.
  376.       print "1H"
  377.       print "hb╒═════════╕  "
  378.       print "1H"
  379.       print "b│    c "
  380.       print CARD
  381.       print "b │  "
  382.       print "1H"
  383.       print "b│         │  "
  384.       print "1H"
  385.       print "b│   C B   │  "
  386.       print "1H"
  387.       print "b│         │  "
  388.       print "1H"
  389.       print "b│ c"
  390.       print CARD
  391.       print "b     │  "
  392.       print "1H"
  393.       print "b╘═════════╛  "
  394.       print "1H"
  395.       print "yThe card is a: c"
  396.       print CARD
  397.       print "        "
  398.     end_if
  399.   end_case
  400.   case 1
  401.   compare CARD 10
  402.     if_less
  403. # Display second card hit on column 15  (15H)
  404.       print "15H"
  405.       print "hb╒════════╕  "
  406.       print "15H"
  407.       print "b│    c "
  408.       print CARD
  409.       print "b │  "
  410.       print "15H"
  411.       print "b│        │  "
  412.       print "15H"
  413.       print "b│   CB   │  "
  414.       print "15H"
  415.       print "b│        │ "
  416.       print "15H"
  417.       print "b│ c"
  418.       print CARD
  419.       print "b     │  "
  420.       print "15H"
  421.       print "b╘════════╛  "
  422.       print "1H"
  423.       print "wThe card is a: g"
  424.       print CARD
  425.       print "      "
  426.     else
  427.       print "15H"
  428.       print "hb╒═════════╕  "
  429.       print "15H"
  430.       print "b│     c"
  431.       print CARD
  432.       print "b │  "
  433.       print "15H"
  434.       print "b│         │  "
  435.       print "15H"
  436.       print "b│   C B   │  "
  437.       print "15H"
  438.       print "b│         │  "
  439.       print "15H"
  440.       print "b│ c"
  441.       print CARD
  442.       print "b     │  "
  443.       print "15H"
  444.       print "b╘═════════╛  "
  445.       print "1H"
  446.       print "yThe card is a: c"
  447.       print CARD
  448.       print "        "
  449.     end_if
  450.   end_case
  451.   case 2
  452.   compare CARD 10
  453.     if_less
  454. # Display third card hit on column 30  (30H)
  455.       print "30H"
  456.       print "hb╒════════╕  "
  457.       print "30H"
  458.       print "b│    c "
  459.       print CARD
  460.       print "b │  "
  461.       print "30H"
  462.       print "b│        │  "
  463.       print "30H"
  464.       print "b│   CB   │  "
  465.       print "30H"
  466.       print "b│        │ "
  467.       print "30H"
  468.       print "b│c "
  469.       print CARD
  470.       print "b     │  "
  471.       print "30H"
  472.       print "b╘════════╛  "
  473.       print "1H"
  474.       print "wThe card is a: g"
  475.       print CARD
  476.       print "      "
  477.     else
  478.       print "30H"
  479.       print "hb╒═════════╕  "
  480.       print "30H"
  481.       print "b│     c"
  482.       print CARD
  483.       print "b │  "
  484.       print "30H"
  485.       print "b│         │  "
  486.       print "30H"
  487.       print "b│   C B   │  "
  488.       print "30H"
  489.       print "b│         │  "
  490.       print "30H"
  491.       print "b│ c"
  492.       print CARD
  493.       print "b     │  "
  494.       print "30H"
  495.       print "b╘═════════╛  "
  496.       print "1H"
  497.       print "yThe card is a: c"
  498.       print CARD
  499.       print "        "
  500.     end_if
  501.   end_case
  502.   case 3
  503.   compare CARD 10
  504.     if_less
  505. # Display fourth card hit on column 45 (45H)
  506.       print "45H"
  507.       print "hb╒════════╕  "
  508.       print "45H"
  509.       print "b│    c "
  510.       print CARD
  511.       print "b │  "
  512.       print "45H"
  513.       print "b│        │  "
  514.       print "45H"
  515.       print "b│   CB   │  "
  516.       print "45H"
  517.       print "b│        │ "
  518.       print "45H"
  519.       print "b│ c"
  520.       print CARD
  521.       print "b     │  "
  522.       print "45H"
  523.       print "b╘════════╛  "
  524.       print "1H"
  525.       print "wThe card is a: g"
  526.       print CARD
  527.       print "      "
  528.     else
  529.       print "45H"
  530.       print "hb╒═════════╕  "
  531.       print "45H"
  532.       print "b│     c"
  533.       print CARD
  534.       print "b │  "
  535.       print "45H"
  536.       print "b│         │  "
  537.       print "45H"
  538.       print "b│   C B   │  "
  539.       print "45H"
  540.       print "b│         │  "
  541.       print "45H"
  542.       print "b│ c"
  543.       print CARD
  544.       print "b     │  "
  545.       print "45H"
  546.       print "b╘═════════╛  "
  547.       print "1H"
  548.       print "yThe card is a: c"
  549.       print CARD
  550.       print "        "
  551.     end_if
  552.   end_case
  553.   case 4
  554.   compare CARD 10
  555.     if_less
  556. # Display fifth & last card pick on column 60  (60H)
  557.       print "60H"
  558.       print "hb╒════════╕  "
  559.       print "60H"
  560.       print "b│    c "
  561.       print CARD
  562.       print "b │  "
  563.       print "60H"
  564.       print "b│        │  "
  565.       print "60H"
  566.       print "b│   CB   │  "
  567.       print "60H"
  568.       print "b│        │ "
  569.       print "60H"
  570.       print "b│c "
  571.       print CARD
  572.       print "b     │  "
  573.       print "60H"
  574.       print "b╘════════╛  "
  575.       print "1H"
  576.       print "wThe card is a: g"
  577.       print CARD
  578.       print "      "
  579.     else
  580.       print "60H"
  581.       print "hb╒═════════╕  "
  582.       print "60H"
  583.       print "b│     c"
  584.       print CARD
  585.       print "b │  "
  586.       print "60H"
  587.       print "b│         │  "
  588.       print "60H"
  589.       print "b│   C B   │  "
  590.       print "60H"
  591.       print "b│         │  "
  592.       print "60H"
  593.       print "b│ c"
  594.       print CARD
  595.       print "b     │  "
  596.       print "60H"
  597.       print "b╘═════════╛  "
  598.       print "1H"
  599.       print "yThe card is a: c"
  600.       print CARD
  601.       print "        "
  602.     end_if
  603.   end_case
  604. end_switch
  605.  
  606. # COUNT is used to keep track of Hits or cards drawn.
  607. # After drawing a CARD, it is added to variable TOTAL.
  608. add COUNT 1
  609. add TOTAL CARD
  610.  
  611. # There is a BONUS for those who draw 5 cards
  612. # Checking for it here.
  613. compare COUNT 5
  614.   if_true
  615.     cmd_pop
  616.     goto bigtest
  617.   end_if
  618.  
  619. # Checking TOTAL for Blackjack.
  620. compare TOTAL 21
  621.   if_true
  622.     cmd_pop
  623.     goto super
  624.   end_if
  625.  
  626. # Is TOTAL less than 21?  See if they want another HIT.
  627. compare TOTAL 21
  628.   if_less
  629.     cmd_pop
  630.     goto choosecard
  631.   end_if
  632.  
  633. # TOTAL over 21?  Oh Crap...  BUSTED.
  634. compare TOTAL 21
  635.   if_greater
  636.     cmd_pop
  637.     goto crap
  638.   end_if
  639.  
  640. # When they don't want another HIT - they STAY.
  641. # Now we have to determine what CREDIT action
  642. # to take based upon their card TOTAL.
  643. # See Menu for what TOTALs earn what CREDITS.
  644. # Feel Free to customize the CREDIT structures.
  645. # Checking here for a TOTAL less than 8.
  646. :stay
  647. compare TOTAL 8
  648.   if_less_or_equal
  649.     cmd_pop
  650.     goto losetwofive
  651.   else
  652.     cmd_pop
  653.     goto testtwo
  654.   end_if
  655.  
  656. # TOTAL Less than 8?  Yikes!  -25
  657. # Again using ANSI sequences for placement of text, or clearing of text.
  658. :losetwofive
  659. print "1H"
  660. print "hwYour total for this hand was: hb"
  661. print TOTAL
  662. print "   n"
  663. crlf
  664. print "                                                           n"
  665. crlf
  666. print "hmThe SysOp Chuckles as he snatches hr25 khm of your credits!n"
  667. crlf
  668. print "1Hn                                                  n\r"
  669. pause
  670.  
  671. # Adjusting credits accordingly and tracking their overall winnings.
  672. adjust_user_credits -25
  673. sub WINNINGS 25
  674. cmd_pop
  675. goto top
  676.  
  677. # Checking for TOTAL between 9 & 13
  678. :testtwo
  679. compare TOTAL 13
  680.   if_less_or_equal
  681.     cmd_pop
  682.     goto loseten
  683.   else
  684.     cmd_pop
  685.     goto testthree
  686.   end_if
  687.  
  688. # TOTAL between 9-13.  Too Bad.  -10
  689. :loseten
  690. print "1H"
  691. print "hwYour total for this hand was: hb"
  692. print TOTAL
  693. print "   n"
  694. crlf
  695. print "                                                           n"
  696. crlf
  697. Print "hmSay goodbye to hr10 khm of your Credits for staying with 13 or less!n"
  698. crlf
  699. print "1Hn                                                  n\r"
  700. pause
  701. adjust_user_credits -10
  702. sub WINNINGS 10
  703. cmd_pop
  704. goto top
  705.  
  706. # Checking for TOTAL between 14 & 17
  707. :testthree
  708. compare TOTAL 17
  709.   if_less_or_equal
  710.     cmd_pop
  711.     goto gainfive
  712.   else
  713.     cmd_pop
  714.     goto testfour
  715.   end_if
  716.  
  717. # TOTAL between 14-17.  They played it SAFE.  +5
  718. # Since it cost 5 to play, they gain or lose nothing.
  719. :gainfive
  720. print "1H"
  721. print "hwYour total for this hand was: hb"
  722. print TOTAL
  723. print "   n"
  724. crlf
  725. print "                                                           n"
  726. crlf
  727. print "hmSmart Move!  Playing it safe earned youhr 5 khm Credits.n"
  728. crlf
  729. print "1Hn                                                  n\r"
  730. pause
  731. adjust_user_credits 5
  732. add WINNINGS 5
  733. cmd_pop
  734. goto top
  735.  
  736. # TOTAL between 18-20.  Ahh, a Winner!  +25
  737. :testfour
  738. print "1H"
  739. print "hwYour total for this hand was: hb"
  740. print TOTAL
  741. print "   n"
  742. crlf
  743. print "                                                           n"
  744. crlf
  745. print_remote ""
  746. print "hmWow!  What luck @USER@!  You win r25 km Credits!!!!n"
  747. crlf
  748. print "1Hn                                                  n\r"
  749. pause
  750. adjust_user_credits 25
  751. add WINNINGS 25
  752. cmd_pop
  753. goto top
  754.  
  755. # TOTAL = 21  CHUCKLE BLACK JACK!  +50
  756. :super
  757. print "1H"
  758. print "hwYour total for this hand was: hb"
  759. print TOTAL
  760. print "   n"
  761. crlf
  762. print "                                                           n"
  763. crlf
  764. # Send them fancy stereo feedback for winning.  <Chuckle>
  765. print_remote ""
  766. print "hmYou've hit 21-BLACKJACK you lucky hacker you!!!n"
  767. crlf
  768. print "hyThe SysOp addsr 50 ky credits to your account with a scowl...n"
  769. crlf
  770. print "1Hn                                                  n\r"
  771. pause
  772. adjust_user_credits 50
  773. add WINNINGS 50
  774. cmd_pop
  775. goto top
  776.  
  777. # Took 5 cards and the TOTAL was 21 or less?
  778. # Not easy to do so reward them!  +150
  779. :overfive
  780. print "1H"
  781. print "hwYour total for this hand was: hb"
  782. print TOTAL
  783. print "   n"
  784. crlf
  785. print "                                                           n"
  786. crlf
  787. print_remote ""
  788. print "hmYou took 5 cards and have 21 or less.  You get Bonus Credits!!!n"
  789. crlf
  790. print "hyThe SysOp painfully addsr 150 ky credits to your account with a howl...n"
  791. crlf
  792. print "1Hn                                                  n\r"
  793. pause
  794. adjust_user_credits 150
  795. add WINNINGS 150
  796. cmd_pop
  797. goto top
  798.  
  799. # TOTAL over 21.  BUSTED!   -25
  800. :crap
  801. print "1H"
  802. print "hwYour total for this hand was: hb"
  803. print TOTAL
  804. print "   n"
  805. crlf
  806. print "                                                           n"
  807. crlf
  808. print "hmUh Oh . . . You've busted big time with a score of: hr"
  809. print TOTAL
  810. print ".n"
  811. crlf
  812. print "hyThe SysOp pockets away r25 ky of your credits with a Chuckle...n"
  813. crlf
  814. print "1Hn                                                  n\r"
  815. pause
  816. adjust_user_credits -25
  817. sub WINNINGS 25
  818. cmd_pop
  819. goto top
  820.  
  821. # If COUNT in a previous check indicated 5 cards had been drawn,
  822. # this is the bigtest to see if they win big CREDITS.
  823. :bigtest
  824. compare TOTAL 21
  825.   if_less_or_equal
  826.     cmd_pop
  827.     goto overfive
  828.   end_if
  829. compare TOTAL 21
  830.   if_greater
  831.     cmd_pop
  832.     goto crap
  833.   end_if
  834.  
  835. # Leaving so soon?   Let's see if they won or lost
  836. # and send them the appropriate feedback.
  837. # They started out with WINNINGS = 0
  838. :leave
  839. # No trackplay = No play.  Bypass logging no-play activity.
  840. compare trackplay 0
  841.   if_equal
  842.     cmd_pop
  843.     goto byebye
  844.   end_if
  845. compare WINNINGS 0
  846.   if_equal
  847.     cmd_pop
  848.     goto nochange
  849.   end_if
  850. compare WINNINGS 0
  851.   if_greater
  852.     cmd_pop
  853.     goto playerwon
  854.   else
  855.     cmd_pop
  856.     goto userlost
  857.   end_if
  858.  
  859. # No winings - No loss.
  860. :nochange
  861. crlf
  862. crlf
  863. print "hyYou came out exactly hmEVENhy @USER@.n"
  864. crlf
  865. crlf
  866. pause
  867. # Append GUESS.LOG for No Change.  Plays/User/Date/Credits
  868.   FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\blackjck.log"
  869.     str uno dos
  870.     copy str trackplay
  871. # Number of Plays Info.  Display formality.  Print Play or Plays?
  872.     compare trackplay 1
  873.       if_equal
  874.         fprintf file "mh%s ngplay by wh" str
  875.       else
  876.         fprintf file "mh%s ngplays by wh" str
  877.       end_if
  878. # User Alias
  879.     fwrite file _useron.alias
  880.     set uno " ngon hy"
  881.     fprintf file "%s" uno
  882.     int t
  883.     time t
  884.     time_str str t
  885.     shift_str 4
  886. # Date/Time
  887.     fprintf file "%s" str
  888. # Credit Results - Adding a return on the end of the line.
  889.     set dos "ng.  Results: rhEven\r\n"
  890.     fprintf file "%s" dos
  891.   FCLOSE file
  892. cmd_pop
  893. goto byebye
  894.  
  895. # TOTAL above zero - Player Won Credits!
  896. :playerwon
  897. crlf
  898. crlf
  899. print "hyYou've won a grand total of hm"
  900. print WINNINGS
  901. print " hyk Credits @USER@.n
  902. crlf
  903. crlf
  904. pause
  905.   FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\blackjck.log"
  906.     str uno dos
  907.     copy str trackplay
  908.     compare trackplay 1
  909.       if_equal
  910.         fprintf file "mh%s ngplay by wh" str
  911.       else
  912.         fprintf file "mh%s ngplays by wh" str
  913.       end_if
  914.     fwrite file _useron.alias
  915.     set uno " ngon hy"
  916.     fprintf file "%s" uno
  917.     int t
  918.     time t
  919.     time_str str t
  920.     shift_str 4
  921.     fprintf file "%s" str
  922.     set dos "ng.  Results: wh+"
  923.     fprintf file "%s" dos
  924.     copy str winnings
  925.     fprintf file "%s k\r\n" str
  926.   FCLOSE file
  927. cmd_pop
  928. goto byebye
  929.  
  930. # TOTAL below 0 (negative)  User Lost!
  931. :userlost
  932. crlf
  933. crlf
  934. print "hyYou lost a total of hm"
  935. print WINNINGS
  936. print " hyk Credits @USER@n"
  937. crlf
  938. crlf
  939. pause
  940.   FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\blackjck.log"
  941.     str uno dos
  942.     copy str trackplay
  943.     compare trackplay 1
  944.       if_equal
  945.         fprintf file "mh%s ngplay by wh" str
  946.       else
  947.         fprintf file "mh%s ngplays by wh" str
  948.       end_if
  949.     fwrite file _useron.alias
  950.     set uno " ngon hy"
  951.     fprintf file "%s" uno
  952.     int t
  953.     time t
  954.     time_str str t
  955.     shift_str 4
  956.     fprintf file "%s" str
  957.     set dos "ng.  Results: rh"
  958.     fprintf file "%s" dos
  959.     copy str winnings
  960.     fprintf file "%s k\r\n" str
  961.   FCLOSE file
  962. cmd_pop
  963. goto byebye
  964.  
  965. # Exiting Script.
  966. :byebye
  967.